package cn.ac.siom.query.dao.impl;

import cn.ac.siom.query.dao.IPatents_infoDAO;
import cn.ac.siom.query.vo.Patents_info;
import org.apache.ibatis.session.SqlSessionFactory;
import org.mybatis.spring.support.SqlSessionDaoSupport;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.sql.SQLException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;

@Repository
public class Patents_infoDAOImpl extends SqlSessionDaoSupport implements IPatents_infoDAO {
    @Autowired
    public Patents_infoDAOImpl(SqlSessionFactory sqlSessionFactory){
        super.setSqlSessionFactory(sqlSessionFactory);
    }


    @Override
    public boolean doCreate(Patents_info vo) throws SQLException {
        return false;
    }

    @Override
    public boolean doUpdate(Patents_info vo) throws SQLException {
        return false;
    }

    @Override
    public boolean doRemove(Set<?> ids) throws SQLException {
        return false;
    }

    @Override
    public Patents_info findById(Integer id) throws SQLException {
        return null;
    }

    @Override
    public List<Patents_info> findAll() throws SQLException {
        return super.getSqlSession().selectList("Patents_infoNS.findAll");
    }

    @Override
    public List<Patents_info> findAllBySplit(String column, String keyWord, Integer currentPage, Integer lineSize) throws SQLException {
        return null;
    }

    @Override
    public Integer getAllCount(String column, String keyWord) throws SQLException {
        return null;
    }

    @Override
    public List<Patents_info> findNo(Integer id) throws SQLException {
        Map<String, Integer> map= new HashMap<>();
        map.put("i_id",id);
        return super.getSqlSession().selectList("Patents_infoNS.findNo", map);
    }
}
